package com.tm.controller;

import com.tm.pojo.dto.UserPositionDto;
import com.tm.result.Result;
import com.tm.service.HomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiaobai
 * @create 2022-12-16 20:46
 */
@RestController
@RequestMapping("api/homePage")
public class HomePageController {

    @Autowired
    private HomePageService homePageService;

    //精选活动
    @PostMapping("selectedActivities")
    public Result selectedActivities(){


        return homePageService.selectedActivities();
    }

    //每日必选
    @PostMapping("dailyRequired")
    public Result dailyRequired(Integer userAge){

        return homePageService.dailyRequired(userAge);
    }

    //看视频
    @PostMapping("homeVideo")
    public Result homeVideo(Integer pageNow,Integer pageSize){

        return  homePageService.homeVideo(pageNow,pageSize);
    }

    //有好货 每个商家商品推荐3个
    @PostMapping("haveNiceGoods")
    public Result haveNiceGoods(){

        return homePageService.haveNiceGoods();
    }

    //美学院
    @PostMapping("beautifulInstitute")
    public Result beautifulInstitute(Long userId,Long dateTime){

        return homePageService.beautifulInstitute(userId,dateTime);
    }

    //查询附近店铺
    @PostMapping("nearShop")
    public Result nearShop(UserPositionDto userPositionDto){

        return homePageService.nearShop(userPositionDto);
    }
}
